<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>开始使用layui</title>
<link rel="shortcut icon" href="#" />
<link rel="stylesheet" href="./layui/css/layui.css">
<script src="./layui/layui.js"></script>
</head>
<body>
<div id="main" style="width: 600px;height:400px;"></div>
<div id="main" style="width: 600px;height:400px;"></div>

<script>
layui.config({
	base: './layui/lay/mymod/'
})

layui.use(['jquery', 'echarts'], function(){
	var $ = layui.jquery
		,echarts = layui.echarts;
	console.log($('#main'));
	console.log(document.getElementById('main'));
	$('#main').html(1);
	var MyChart = echarts.init($('#main')[0]);
	var option = {
		title: {
			text: 'ECharts'
		},
		tooltip: {},
		legend: {
			data:['销量']
		},
		xAxis: {
			data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
		},
		yAxis: {},
		series: [{
			name: '销量',
			type: 'bar',
			data: [5, 20, 36, 10, 10, 20]
		}]
	};
	MyChart.setOption(option);
});
</script>
</body>
</html>